def fun(data):
    def user_risk_level(data):
        predict = data['predict']
        if predict<0.01:
            return 'S'
        elif predict<0.02:
            return 'A'
        elif predict<0.05:
            return 'B1'
        elif predict<0.08:
            return 'B2'
        elif predict<0.10:
            return 'C1'
        elif predict<0.12:
            return 'C2'
        elif predict<0.15:
            return 'C3'
        elif predict<0.18:
            return 'C4'
        elif predict<0.20:
            return 'D1'
        elif predict<0.25:
            return 'D2'
        elif predict<0.30:
            return 'F'
    data['user_risk_level'] = user_risk_level(data)
    return data
